package com.crowdfunding.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.Version;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import java.io.Serializable;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * <p>
 * 
 * </p>
 *
 * @author xiaoyu
 * @since 2021-07-09
 */
//@Accessors(chain = true)
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel("众筹实体类")
public class CrowdFunding extends Model<CrowdFunding> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "cf_id")
    @ApiModelProperty(value = "众筹id")
    private String cfId;

    @ApiModelProperty(value = "众筹名（必填）")
    private String cfName;

    @ApiModelProperty(value = "发起众筹的用户名（必填，以token形式放在请求头中）")
    private String username;

    @ApiModelProperty(value = "众筹详情")
    private String cfIntroduce;

    @ApiModelProperty(value = "众筹图片")
    private String cfImage;

    @ApiModelProperty(value = "是否通过认证")
    private Integer cfAuthentication;

    @ApiModelProperty(value = "众筹所需总金额（必填）")
    private Double cfTotalAmount;

    @ApiModelProperty(value = "已筹得金额")
    private Double cfAlreadyAmount;

    @ApiModelProperty(value = "活动创建时间,格式改为：yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date cfCreateTime;

    @ApiModelProperty(value = "活动截止日期（必填）格式改为：yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date cfDeadline;

    @ApiModelProperty(value = "标签标识（不填为空）")
    private boolean cfTag1;

    private boolean cfTag2;

    private boolean cfTag3;

    private boolean cfTag4;

    @TableLogic
    @JsonIgnore
//    @ApiModelProperty(value = "逻辑删除标识")
    private Integer deleted;


    @ApiModelProperty( value = "状态码：0（待审核）；1（审核成功，发布）；2（众筹结束）")
    private Integer status;

//    @ApiModelProperty(value = "乐观锁")
    @Version
    @JsonIgnore
    private Integer version;


    @Override
    public Serializable pkVal() {
        return this.cfId;
    }


}
